-
Notifications
You must be signed in to change notification settings - Fork 4
refactor: Code cleanup Pt2 #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: code-cleanup
Are you sure you want to change the base?
Conversation
Ninerian
commented
Oct 29, 2025
- raised phpstan to level 7 and fixed all issues
- Updated phpstan.neon.dist to level 4 - Removed unused expressions in PluginSessionTest - Fixed always-true ternary in SSODataTest - Refined assertion in SSOTokenTest to avoid redundant type check - Removed unreachable code after markTestSkipped statements - Added proper assertions to make mock object usage meaningful 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Updated phpstan.neon.dist to level 5 - Fixed type parameter in HasInstanceId::hasInstanceId() method from Plain to UnencryptedToken - Removed unused Plain token import - Aligns with lcobucci/jwt library token type hierarchy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
e88e6fe to
3300537
Compare
- Updated phpstan.neon.dist to level 4 - Removed unused expressions in PluginSessionTest - Fixed always-true ternary in SSODataTest - Refined assertion in SSOTokenTest to avoid redundant type check - Removed unreachable code after markTestSkipped statements - Added proper assertions to make mock object usage meaningful 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Updated phpstan.neon.dist to level 6 - Added comprehensive array type annotations (array<string,mixed>) - Added missing return type declarations for all methods - Added missing property type declarations - Fixed PHPUnit mock template type resolution - Added proper DocBlock annotations for complex types - Removed unused properties - Applied fixes across src/ and test/ directories Major improvements: - AbstractToken.php: array types and return types - SSOData traits: comprehensive type annotations - Test classes: complete type coverage and mock annotations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Updated phpstan.neon.dist to level 7 - Added non-empty-string validation for JWT library methods - Enhanced AbstractToken with proper string validation for claim names and keys - Fixed SSOToken and SSOTokenGenerator with empty string checks - Improved SessionHandlerTrait type handling for session_id() return values - Added proper class-string annotations in test files - Maintained backward compatibility while ensuring type safety Key improvements: - hasClaim/getClaim methods validate non-empty claim names - Key handling methods validate non-empty PEM strings and file paths - Session handling properly manages string|false vs string|null types - All string parameters validated before passing to strict library functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1fa3c3c to
6a34427
Compare
acc47ef to
0ed5e27
Compare
m-seidel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also run the linter and commit the changes from it.
It brought up some changes in
modified: src/AbstractToken.php
modified: test/SSOData/SSODataTest.php
| /** | ||
| * @return mixed | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /** | |
| * @return mixed | |
| */ |
This is a duplication
| * | ||
| * @return array | ||
| */ | ||
| /** | ||
| * @return array<string, mixed> | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * | |
| * @return array | |
| */ | |
| /** | |
| * @return array<string, mixed> | |
| */ | |
| * | |
| * @return array<string, mixed> | |
| */ |
| * @param string $privateKey private key | ||
| * @param array $tokenData associative array of claims | ||
| * @param Signer|null $signer the Signer instance to sign the token, defaults to SHA256 | ||
| * | ||
| * @return string Encoded token. | ||
| */ | ||
| /** | ||
| * @param array<string,mixed> $tokenData | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seams to be a bit mixed up
| * @param array $tokenData | ||
| * @return Token | ||
| */ | ||
| /** | ||
| * @param array<string,mixed> $tokenData | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @param array $tokenData | |
| * @return Token | |
| */ | |
| /** | |
| * @param array<string,mixed> $tokenData | |
| */ | |
| * @param array<string,mixed> $tokenData | |
| * @return Token | |
| */ |
| /** | ||
| * @return array<string,mixed> | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pleas update the commented return line above and remove the duplication
| * @return array Associative array of claim accessors. | ||
| */ | ||
| /** | ||
| * @return array<string,string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pleas update the commented return line above and remove the duplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is needed